home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Gold Collection
/
Software Vault - The Gold Collection (American Databankers) (1993).ISO
/
cdr48
/
ppascal.zip
/
SPIRAL1.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1993-04-24
|
1KB
|
40 lines
program spiral;
uses
crt,graph;
const
TotalDiam = 9000; { final diameter of the spiral }
LineDist = 20; { distance between the lines }
width = 1; { line width: 1=narrow, 3=wide }
x = 320;
y = 240;
var
Gd, Gm : Integer;
radius, angle, z : integer;
ch : char;
begin
randomize;
Gd := Detect; InitGraph(Gd, Gm, 'c:\utils\tp');
if GraphResult <> grOk then Halt(1);
radius:=1;
angle:=0;
setcolor(random(getmaxcolor-1)+1);
setlinestyle(0,0,width);
for z:= 1 to TotalDiam do
begin
{ setcolor ( random ( getmaxcolor ) +1 ); }
arc ( x, y, angle, angle + 1, radius );
inc ( angle );
if z mod linedist = 0 then inc ( radius, 1 );
if angle=360 then angle:=0;
if keypressed then
begin
ch := readkey;
ch := readkey;
closegraph;
halt(1);
end;
end;
ch := readkey;
closegraph;
end.